<!--  -->
<template>
  <el-config-provider :locale="zhCn">
    <router-view v-slot="{ Component }">
        <component :is="Component"/>
    </router-view>
  </el-config-provider>


</template>
<script setup lang='ts' >
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import { computed, watchEffect } from 'vue'
import { ElConfigProvider } from 'element-plus'
import {useRoute} from "vue-router"
import { setTheme } from '@/assets/theme/theme'
import { useStore } from "@/store"
const store = useStore()
const route = useRoute()
const theme = computed(() => store.state.defaultConfig.theme)
if(theme){
  setTheme(theme.value) // 开启默认主题样式
}else{
  setTheme('default')
}

watchEffect(() => {
  window.addEventListener('resize', function () {
    if (~~window.innerWidth < 990) {
      store.dispatch('defaultConfig/isFoldAction', true)
    } else {
      store.dispatch('defaultConfig/isFoldAction', false)
    }
  })
})


</script>
<style lang='less' scoped>


</style>
